package com.hl.im.server.controller;

import com.hl.im.server.feign.HelloServiceFeign;
import com.hl.im.server.infrastrructure.session.ISessionStore;
import io.netty.channel.group.ChannelGroupFuture;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.Instant;

/**
 * @author huanglin
 * @apiNote
 * @date: 2023/09/09 11:40
 */
@RestController
@RequestMapping(value = "test")
@RequiredArgsConstructor
@Slf4j
public class GatewayController {

    @Resource
    private HelloServiceFeign helloServiceFeign;

    @PostMapping(value = "get")
    @SneakyThrows
    public String get(String id) {
//        assert id==null;
        log.info("打印日志，试试mdc traceId");
        return "test/get请求";
    }


    @PostMapping(value = "post")
    @SneakyThrows
    public String post() {
        String resource = helloServiceFeign.getResource();
        log.info("feign外部地址请求成功,res = {}",resource);
        return "test/post请求";
    }


}
